this._tilePreview.hide();
},
- _showWindowMenu: function(shellwm, window, x, y) {
- this._windowMenuManager.showForWindow(window, x, y);
+ _showWindowMenu: function(shellwm, window, menu, x, y) {
+ this._windowMenuManager.showWindowMenuForWindow(window, menu, x, y);
},
_startAppSwitcher : function(display, screen, window, binding) {
const BoxPointer = imports.ui.boxpointer;
const Main = imports.ui.main;
const PopupMenu = imports.ui.popupMenu;
+const RemoteMenu = imports.ui.remoteMenu;
const WindowMenu = new Lang.Class({
Name: 'WindowMenu',
}
});
+const AppMenu = new Lang.Class({
+ Name: 'AppMenu',
+ Extends: RemoteMenu.RemoteMenu,
+
+ _init: function(window) {
+ let app = Shell.WindowTracker.get_default().get_window_app(window);
+
+ this.parent(Main.layoutManager.dummyCursor, app.menu, app.action_group);
+
+ this.actor.add_style_class_name('fallback-app-menu');
+
+ Main.layoutManager.uiGroup.add_actor(this.actor);
+ this.actor.hide();
+ }
+});
+
const WindowMenuManager = new Lang.Class({
Name: 'WindowMenuManager',
this._manager = new PopupMenu.PopupMenuManager({ actor: Main.layoutManager.dummyCursor });
},
- showForWindow: function(window, x, y) {
- let menu = new WindowMenu(window);
+ showWindowMenuForWindow: function(window, type, x, y) {
+ let menu = (type == Meta.WindowMenuType.WM) ? new WindowMenu(window)
+ : new AppMenu(window);
+
this._manager.addMenu(menu);
Main.layoutManager.setDummyCursorGeometry(x, y, 0, 0);
if (!isOpen)
menu.destroy();
}));
- },
+ }
});
MetaRectangle *tile_rect,
int tile_monitor);
static void gnome_shell_plugin_hide_tile_preview (MetaPlugin *plugin);
-static void gnome_shell_plugin_show_window_menu (MetaPlugin *plugin,
- MetaWindow *window,
- int x,
- int y);
+static void gnome_shell_plugin_show_window_menu (MetaPlugin *plugin,
+ MetaWindow *window,
+ MetaWindowMenuType menu,
+ int x,
+ int y);
static gboolean gnome_shell_plugin_xevent_filter (MetaPlugin *plugin,
XEvent *event);
}
static void
-gnome_shell_plugin_show_window_menu (MetaPlugin *plugin,
- MetaWindow *window,
- int x,
- int y)
+gnome_shell_plugin_show_window_menu (MetaPlugin *plugin,
+ MetaWindow *window,
+ MetaWindowMenuType menu,
+ int x,
+ int y)
{
- _shell_wm_show_window_menu (get_shell_wm (), window, x, y);
+ _shell_wm_show_window_menu (get_shell_wm (), window, menu, x, y);
}
static gboolean
void _shell_wm_hide_tile_preview (ShellWM *wm);
void _shell_wm_show_window_menu (ShellWM *wm,
MetaWindow *window,
+ MetaWindowMenuType menu,
int x,
int y);
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
- G_TYPE_NONE, 3,
- META_TYPE_WINDOW, G_TYPE_INT, G_TYPE_INT);
+ G_TYPE_NONE, 4,
+ META_TYPE_WINDOW, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
shell_wm_signals[FILTER_KEYBINDING] =
g_signal_new ("filter-keybinding",
G_TYPE_FROM_CLASS (klass),
}
void
-_shell_wm_show_window_menu (ShellWM *wm,
- MetaWindow *window,
- int x,
- int y)
+_shell_wm_show_window_menu (ShellWM *wm,
+ MetaWindow *window,
+ MetaWindowMenuType menu,
+ int x,
+ int y)
{
- g_signal_emit (wm, shell_wm_signals[SHOW_WINDOW_MENU], 0, window, x, y);
+ g_signal_emit (wm, shell_wm_signals[SHOW_WINDOW_MENU], 0, window, menu, x, y);
}
void